package month1;

import java.util.Arrays;

public class MoveZeroes283_01 {
    public static void main(String[] args) {
        moveZeroes(new int[]{0,1,0,3,12});
    }
    static  void moveZeroes(int[] nums) {
        int i = 0;
        for (int num : nums) {
            if (num != 0) {
                nums[i++] = num;
            }
        }
        while(i < nums.length) {
            nums[i++] = 0;
        }

        // 打印
        System.out.println(Arrays.toString(nums));
    }
}
